/**
 * article
 */
var yLoader = new YLoader();

var faces = new YFace('content', 'y-formFace').init();
var yForm = null;
yLoader.use(Y._CDN_ + '/js/YPostForm.js', function(){
	yForm = new YPostForm(['nickname', 'email', 'website', 'content', 'pid'], 
		['nickname', 'content']);
});
	
function postData() {
	var btn = document.getElementById('ySubmitBtn');
	var str = yForm.serialize();
	var notifyme = document.getElementById('notifyme').checked ? 1 : 0;
	
	var nickname = yForm.getData('nickname');
	var con = yForm.getData('content');
	var err = '';
	if('' == articleid) {
		err += '参数错误 \n';
	}
	if('' == nickname) {
		err += '昵称不能为空 \n';
	}
	if('' == con) {
		err += '内容不能为空 \n';
	}
	if('' != err) {
		alert(err);
		return;
	}
	
	str += '&notifyme='+ notifyme +'&articleid='+articleid;
	
	btn.disabled = true;
	jQuery.post(U('Detail/ajax_postComment'), str, function(r){
		btn.disabled = false;
		document.getElementById('commentList').innerHTML += r;
		window.f1.reset();
	});
	
}
